﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
 <HEAD>
  <TITLE> ZTREE DEMO </TITLE>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <link rel="stylesheet" href="demoStyle/demo.css" type="text/css">
  <link rel="stylesheet" href="zTreeStyle/zTreeStyle.css" type="text/css">
  <script type="text/javascript" src="jquery-1.4.2.js"></script>
  <script type="text/javascript" src="jquery.ztree-2.6.js"></script>


  <SCRIPT LANGUAGE="JavaScript">
  <!--
	//success do
			function zTreeOnAsyncSuccess(event, treeId, msg)
			 { 
				//zTree.openLevel();
			 }
			function showIconForTree(treeId, treeNode) {
	    		return !treeNode.isParent;
			};	
			//onload
			var	zTree;
			$(document).ready(function(){
				 // Tree		
				var setting = {
					checkable: false,
					callback : {
	      				click: zTreeOnClick,
	      				asyncSuccess: zTreeOnAsyncSuccess
	   				 },
			async: true,
			asyncUrl: "asyncData/node.txt",  //获取节点数据的URL地址
			asyncParam: ["name", "id"],  //获取节点数据时，必须的数据名称，例如：id、name
			asyncParamOther: ["test","true"] //其它参数 ( key, value 键值对格式)

				};
				var zNodes =[];				 
				zTree = $("#tree").zTree(setting, zNodes);
			});
			


  //-->
  </SCRIPT>
 </HEAD>

<BODY>
<body scroll="auto">
		<div>
			<div id="tree" class="tree"></div>
		</div>
	</body>

 </BODY>
</HTML>
<script type="text/javascript">
//method:clickTreeNode
function zTreeOnClick(event,treeId,treeNode){
	
	alert(treeNode.id + ", " + treeNode.name+ ", ");
	
}
</script>

